/********************************************************************
	created:	2012/4/16
	filename: 	DebugDraw.cpp
	author:		Mwolf
	
	purpose:	
*********************************************************************/

#include "stdafx.h"

#include "DebugDraw.h"
#include "Renderer/GWRenderDevice.h"

#include <list>

struct DrawListCmd
{
	BoundBox	box;
	GWColor		color;
	float		depth;
};

static std::list<DrawListCmd> DebugDrawList;

void DebugDrawList_Clear()
{
	DebugDrawList.clear();
}

void DebugDrawList_DrawBoundingBox( const BoundBox& box, const GWColor& color, float depth /*= 0.1f */ )
{
	DrawListCmd cmd;

	cmd.box = box;
	cmd.color = color;
	cmd.depth = depth;
	DebugDrawList.push_back( cmd );
}

void DebugDrawList_RenderToBuffer()
{
	std::list<DrawListCmd>::iterator iter;

	for ( iter=DebugDrawList.begin(); iter!=DebugDrawList.end(); iter++ )
	{
		RenderSystem::DrawWireframeRect( iter->box.vMin(), iter->box.vMax(), iter->color, iter->depth );
	}
}
